using System;
using System.Collections.Generic;
using System.Text;

namespace ElteIk.RoboSoccer.Core.Physics
{
	/// <summary>
	/// A common interface for physical objects.
	/// </summary>
	public interface IPhysicalObject
	{
        /// <summary>
        /// The object's location coordinates.
        /// </summary>
		Vector2D Position { get; set; }

        /// <summary>
        /// The velocity vector.
        /// </summary>
		Vector2D Velocity { get; set; }

        /// <summary>
        /// Normalized heading vector. 
        /// </summary>
		Vector2D Heading { get; set; }
        
        /// <summary>
        /// The forces that object is affected by. Read-only and unguaranteed that Physics Engine writes back anything useful into it.
        /// If you want to add forces to the object, use the AddForce or Move method.
        /// </summary>
        IList<FreeVector2D> Forces { get; }

        /// <summary>
        /// Adds a force to the object.
        /// </summary>
        /// <param name="force"></param>
        void AddForce(FreeVector2D force);

        /// <summary>
        /// Clears all the forces.
        /// </summary>
        void ClearForces();

        /// <summary>
        /// If false then the object will not be collidable and unaffected by gravity.
        /// </summary>
        bool IsMovable { get; }

        /// <summary>
        /// The mass of the object. 
        /// </summary>
        float Mass { get; set; }

        /// <summary>
        /// The difference in degrees between the first Heading vector and the current one.
        /// </summary>
        float Rotation { get; set; }
		
        /// <summary>
        /// It inserts the given vector into the Forces collection.
        /// </summary>
        /// <param name="vector"></param>
        void Move(Vector2D vector);

        /// <summary>
        /// Created a clone.
        /// </summary>
        /// <returns></returns>
        IPhysicalObject Clone();
	}
}
